package com.zhouz.admin.app.db.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhouz.admin.app.db.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhangpeng
 * @since 2019-05-09
 */
@Data
@ApiModel(value="SysDic对象", description="")
public class SysDic extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	@ApiModelProperty(value = "类别")
	private String typeCode;

	@ApiModelProperty(value = "类别名")
	private String typeName;

	@ApiModelProperty(value = "值")
	private String code;

	@ApiModelProperty(value = "父级")
	private Integer pid;

	@ApiModelProperty(value = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
	private Date createTime;

	@ApiModelProperty(value = "排序级别")
	private Integer lever;

	@ApiModelProperty(value = "值描述2")
	private String codeText2;

	@ApiModelProperty(value = "值名称")
	private String codeText;

	@ApiModelProperty(value = "值描述3")
	private String codeText3;


	public enum Column {
		id("id", "id"),
		typeCode("type_code", "typeCode"),
		typeName("type_name", "typeName"),
		code("code", "code"),
		pid("pid", "pid"),
		createTime("create_time", "createTime"),
		lever("lever", "lever"),
		codeText2("code_text2", "codeText2"),
		codeText("code_text", "codeText"),
		codeText3("code_text3", "codeText3"),
		;
		private final String column;

		private final String javaProperty;

		public String value() {
			return this.column;
		}

		public String getValue() {
			return this.column;
		}

		public String getJavaProperty() {
			return this.javaProperty;
		}

		Column(String column, String javaProperty) {
			this.column = column;
			this.javaProperty = javaProperty;
		}

		public String desc() {
			return this.column + " DESC";
		}

		public String asc() {
			return this.column + " ASC";
		}
	}
}
